package com.physique.tea.Controller;

import com.physique.tea.Global.Result;
import com.physique.tea.Global.ResultList;
import com.physique.tea.Service.Impl.TcmDataService;
import org.springframework.core.io.ClassPathResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

@RestController
@RequestMapping("/tcm")
public class TcmDataController {

    private final TcmDataService tcmDataService;

    public TcmDataController(TcmDataService tcmDataService) {
        this.tcmDataService = tcmDataService;
    }

    @GetMapping("/process")
    public Result processInternalCsv() throws Exception {

            Map<String, Map<String, Integer>> result = tcmDataService.processInternalCsv();
            return new Result(ResultList.SUCCESS.getCode(),
                    ResultList.SUCCESS.getMessage(),
                    result);

    }


}